{extend name="$layout" /}
{block name="title"}
	{$title}
{/block}

{block name="top"}
    {notempty name="navs"}
    <ul class="nav nav-tabs" >
        {volist name="navs" id="nav"}
        <li class="{$nav.class}"><a href="{$nav.href}" >{$nav.title}</a></li>
        {/volist} 
    </ul>
    {/notempty}
{/block}


{block name="content"} 
	{notempty name="topbtn"}
    {volist name="topbtn" id="btn"}
    <button class="{$btn.class}" type="button" onclick="app.url('{$btn.href}')">{$btn.title}</button>
    {/volist} 
    {/notempty}
     
    {notempty name="submit"} 
    <form class="form-horizontal" onsubmit="{$submit}" id="ajaxForm" method="post">
    {/notempty}
    {notempty name="action"} 
    <form class="form-horizontal" id="ajaxForm" action="{$action}" method="post">
    {/notempty}
        {notempty name="forms"}
        {volist name="forms" id="form"}
            {switch name="form.type"}
                {case value="text"}
                    {include file="./app/common/form/text.html"}
                {/case}
                {case value="text"}
                    {include file="./app/common/form/textarea.html"}
                {/case}
                {case value="static"}
                    {include file="./app/common/form/static.html"}
                {/case}
                {case value="password"}
                    {include file="./app/common/form/password.html"}
                {/case}
                {case value="image"}
                    {include file="./app/common/form/image.html"}
                {/case}
                {case value="ueditor"}
                    {include file="./app/common/form/ueditor.html"}
                {/case}
                {case value="checkbox"}
                    {include file="./app/common/form/checkbox.html"}
                {/case}
                {case value="select"}
                    {include file="./app/common/form/select.html"}
                {/case}
                {case value="radio"}
                    {include file="./app/common/form/radio.html"}
                {/case}
                {case value="hidden"}
                    {include file="./app/common/form/hidden.html"}
                {/case}
                {case value="switch"}
                    {include file="./app/common/form/switch.html"}
                {/case}
                {case value="date"}
                    {include file="./app/common/form/date.html"}
                {/case}
                {case value="daterange"}
                    {include file="./app/common/form/daterange.html"}
                {/case}
                {case value="line"}
                    <div class="hr-line-dashed"></div> 
                {/case}
                {default/}
            {/switch}
        {/volist}
        {/notempty}
        
        <div class="form-group">
            <div class="col-sm-4 col-sm-offset-2">
                {notempty name="btntext"}
                    <button class="btn btn-primary" type="submit">{$btntext}</button> 
                {/notempty}
                {empty name="btntext"}
                    <button class="btn btn-primary" type="submit">保存</button> 
                {/empty}
                
                {notempty name="pid"}
                <input type="hidden" name="pid" value="{$pid}">
                {/notempty}
            </div>
        </div>
    </form> 
 
{/block}